package ningbo.Controlling_Execution;

/**
 * @Author 宁铂
 * @Date 2021/7/12 16:58
 * @Version 1.0
 */
public class IfElse {
    /** 本类用于测试 if-else 的入门案例
     *  需求:通过test()方法告诉您,你猜的数是大于,小于还是等于目标数
     * */

    static int result = 0;
    static void test(int test, int target){
        if(test > target)
            result = +1;
        else if(test < target)
            result = -1;
        else
            result = 0;
    }

    public static void main(String[] args) {
        test(10, 5);
        System.out.println(result);

        test(5, 10);
        System.out.println(result);

        test(5, 5);
        System.out.println(result);
    }

}

